package com.jinbm.common.exception;

import com.jinbm.common.ResultEnum;
import lombok.Data;

/**
 * 业务异常处理
 *
 * @author Jinbm
 * @date 2024/7/8
 * @since 1.0
 */
@Data
public class CustomException extends RuntimeException{

    private Integer code;
    private String msg;

    public CustomException(String msg) {
        this.code = ResultEnum.BUSINESS_ERROR.code;
        this.msg = msg;
    }
    public CustomException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public CustomException(ResultEnum resultEnum){
        this.code = resultEnum.code;
        this.msg = resultEnum.msg;
    }

}
